<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<table>
			<tr>
				<th>id</th>
				<th>名称</th>
				<th>url</th>
				<th>国家</th>
				<th>排名</th>
			</tr>
		</table>
		
		<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
		<script>
			//获取后端传输的数据
			$.get("http://localhost:8080/ServletPractice_war_exploded/websitesServlet")
			.then((data)=>{
				console.log(data)
				var table = $("table");
				for(var i=0;i<data.length;i++){
					table.append(`
					<tr>
					<td>${data[i].id}</td>
					<td>${data[i].name}</td>
					<td>${data[i].url}</td>
					<td>${data[i].country}</td>
					<td>${data[i].alexa}</td>
					</tr>
					`)
				}
			})
		</script>
	</body>
</html>